<?php

/**
 * Afiliado form base class.
 *
 * @method Afiliado getObject() Returns the current form's model object
 *
 * @package    courier
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseAfiliadoForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'afi_id'     => new sfWidgetFormInputHidden(),
      'afi_nombre' => new sfWidgetFormInputText(),
      'afi_token'  => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'afi_id'     => new sfValidatorChoice(array('choices' => array($this->getObject()->getAfiId()), 'empty_value' => $this->getObject()->getAfiId(), 'required' => false)),
      'afi_nombre' => new sfValidatorString(array('max_length' => 50)),
      'afi_token'  => new sfValidatorString(array('max_length' => 255)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Afiliado', 'column' => array('afi_token')))
    );

    $this->widgetSchema->setNameFormat('afiliado[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Afiliado';
  }


}
